package com.tengju.data.infrastructure.schedule;

import com.tengju.user.application.user.UserDocumentJobService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @Author: 李大仙
 * @Date: 2021/3/23 8:14 下午
 */
@Component
@Slf4j
public class UserDocumentEsSyncJob {

    private final UserDocumentJobService userDocumentJobService;

    public UserDocumentEsSyncJob(UserDocumentJobService userDocumentJobService){
        this.userDocumentJobService = userDocumentJobService;
    }

    @XxlJob("userDocumentEsSyncJob")
    public ReturnT<String> execute(String params) {
        userDocumentJobService.sync();
        return ReturnT.SUCCESS;
    }
}
